<template>
	<view v-if="infoCompute">
		<view class="body-top">
			<view class="row px-1">
				<view class="one span24-8 d-flex flex-column a-center">
					<view class="d-flex a-center j-start p-1">
						<text class="text-danger mr-1">(</text>
						<van-button round plain hairline type="danger">
							<text class="d-flex flex-direction j-center">000000</text>
							<text class="d-flex flex-direction j-center text-light-muted">固码(A)</text>
						</van-button>
					</view>
					<text class="text-danger">||</text>
				</view>
				<view class="two span24-8 d-flex flex-column a-center">
					<view class="d-flex a-center j-start py-1 px-0">
						<text class="text-danger mr-2">+</text>
						<van-button style="width: 100%;" round plain hairline type="danger" class="text-center">
							<text class="d-flex flex-direction j-center">{{infoCompute.B==''?'000000':infoCompute.B}}</text>
							<text class="d-flex flex-direction j-center text-light-muted">开奖码(B)</text>
						</van-button>
					</view>
				</view>
				<view class="two span24-8 d-flex flex-column a-center">
					<view class="d-flex a-center j-start py-1">
						<text class="text-danger mr-1">)%</text>
						<van-button style="width: 100%;" round plain hairline type="danger" class="text-center">
							<text class="d-flex flex-direction j-center">{{infoCompute.need_people}}</text>
							<text class="d-flex flex-direction j-center text-light-muted">商品总需人次</text>
						</van-button>
					</view>
				</view>
			</view>
			<view class="row px-1">
				<view class="one span24-8 d-flex flex-column a-center">
					<view class="d-flex a-center j-start p-1">
						<van-button round plain hairline type="danger">
							<text class="d-flex flex-direction j-center">{{(0+parseInt(infoCompute.B==''?0:infoCompute.B))%infoCompute.need_people}}</text>
							<text class="d-flex flex-direction j-center text-light-muted">取得余数</text>
						</van-button>
					</view>
				</view>
				<view class="two span24-8 d-flex flex-column a-center">
					<view class="d-flex a-center j-start py-1 px-0">
						<text class="text-danger mr-2">+</text>
						<van-button style="width: 100%;" round plain hairline type="danger" class="text-center">
							<text class="d-flex flex-direction j-center">10000001</text>
							<text class="d-flex flex-direction j-center text-light-muted">固定数值</text>
						</van-button>
					</view>
				</view>
				<view class="two span24-8 d-flex flex-column a-center">
					<view class="d-flex a-center j-start py-1">
						<text class="text-danger mr-1">=</text>
						<van-button style="width: 100%;" round plain hairline type="danger" class="text-center">
							<text class="d-flex flex-direction j-center">{{infoCompute.win_num}}</text>
							<text class="d-flex flex-direction j-center text-light-muted">最终计算结果</text>
						</van-button>
					</view>
				</view>
			</view>
			<view class="border border-danger bg-white p-2" style="height: 200rpx;width: 720rpx;margin: 0 auto;">
				<text class="d-flex flex-direction">
					数值B
				</text>
				<text class="d-flex flex-direction line-h-md">
					=每10分钟取香港十分彩的开奖结果
				</text>
				<view class="d-flex j-sb">
					<view v-if="infoCompute.lottery_num_id!='miaokai'">
						<text class="d-flex flex-direction font-sm line-h-md">
							(第{{infoCompute.lottery_num_id}}期)
						</text>
						<text class="d-flex flex-direction font-md text-danger line-h-md">
							={{infoCompute.B==''?'000000':infoCompute.B}}
						</text>
					</view>
					<view v-else>
						<text class="d-flex flex-direction font-sm line-h-md">
							(000000为秒开商品)
						</text>
						<text class="d-flex flex-direction font-md text-danger line-h-md">
							={{infoCompute.B==''?'000000':infoCompute.B}}
						</text>
					</view>
					<view class="py-2" v-if="infoCompute.lottery_num_id!='miaokai'">
						<van-button size="mini" type="danger" @click="gotoKaijiangWeb()">开奖查询</van-button>
					</view>
				</view>
			</view>
		</view>
<!-- 		<view class="body-center">
			<view class="bg-warning p-2">
				<text class="text-white text-center">
					截止该商品最后购买时间【{{infoCompute.fightRecordList[0].fight_time_all}}】
					最后50条记录参与记录
				</text>
			</view>
			<view style="background-color:rgb(255, 252, 218) !important;">
				<view class="d-flex mt-1">
					<view class="span24-12">
						<text class="text-light-muted">购买时间</text>
					</view>
					<view class="span24-6">
						<text class="text-danger">转换数据</text>
					</view>
					<view class="span24-6">
						<text class="text-light-muted">购买时间</text>
					</view>
				</view>
				
				<view class="row">
					<view v-for="item in infoCompute.fightRecordList" class="span24-24 d-flex a-center">
						<view class="text-light-muted font-sm"
							style="height: 30px;width:25%;border: 1px solid #FFE08C;text-align:center;line-height: 30px;">
							{{item.fight_time_all.split(" ")[0]}}
						</view>
						<view class="font-sm"
							style="height: 30px;width:25%;border: 1px solid #FFE08C;text-align:center;line-height: 30px;">
							{{item.fight_time_all.split(" ")[1]}}
						</view>
						<view class="text-danger font-sm"
							style="height: 30px;width:25%;border: 1px solid #FFE08C;text-align:center;border-left-color: #dc3545;border-right-color:  #dc3545; line-height: 30px;">
								{{item.fight_time_num}}
						</view>
						<view class="font-sm"
							style="height: 30px;width:25%;border: 1px solid #FFE08C;text-align:center;line-height: 30px;">
							{{item.nick_name}}
						</view>
					</view>
				</view>
			</view>
		</view> -->
		<view class="body-bottom bg-warning">
			<view class="border-bottom border-danger p-2">
				<text class="text-white">
					取以上数值结果得:
				</text>
			</view>
			<view class="border-bottom border-danger p-2">
				<text class="text-white">
					1、固码：000000<text style="color: #ffe38e;">
					</text>
				</text>
			</view>
			<view class="border-bottom border-danger p-2">
				<text class="text-white">
					2、与开奖码相加：000000<text style="color: #ffe38e;">
						(固码)
					</text><text>
						+{{infoCompute.B==''?'000000':infoCompute.B}}
					</text>
					<text v-if="infoCompute.lottery_num_id!='miaokai'" style="color: #ffe38e;">
						(第{{infoCompute.lottery_num_id}}期开奖码)
					</text>
					<text v-else>
						<!-- （000000为秒开商品B值） -->
					</text>
					<text>
						={{0+parseInt(infoCompute.B==''?0:infoCompute.B)}}
					</text>
				</text>
			</view>
			<view class="border-bottom border-danger p-2">
				<text class="text-white">
					3、取余：{{0+parseInt(infoCompute.B==''?0:infoCompute.B)}}<text style="color: #ffe38e;">
						(时间和与开奖码相加之和)
					</text><text>
						%{{infoCompute.need_people}}
					</text>
					<text style="color: #ffe38e;">
						(本商品总须参与人数)
					</text>
					<text>
						={{(0+parseInt(infoCompute.B==''?0:infoCompute.B))%infoCompute.need_people}}
					</text>
					<text style="color: #ffe38e;">
						(余数)
					</text>
				</text>
			</view>
			<view class="border-bottom border-danger p-2">
				<text class="text-white">
					4、计算结果：{{(0+parseInt(infoCompute.B==''?0:infoCompute.B))%infoCompute.need_people}}<text style="color: #ffe38e;">
						(余数)
					</text><text>
						+10000001={{infoCompute.win_num}}
					</text>
				</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getCountInfo
	} from '@/api/lottery.js';

	export default {
		data() {
			return {
				goods_fight_id:"",
				infoCompute:{}
			  }
			},
			onLoad(options){
				console.log(options);
				this.goods_fight_id=options.goods_fight_id;
			},
			onShow() {
				//异步获取首页数据
				 Promise.all([this.getCountInfo()]);
				 // let id = this.$route.query.id;
				 // console.log(id);
			},
			methods: {
				gotoKaijiangWeb() {
					location.href = "http://json.xasxcn.cn/json/tmg";
				},
				getCountInfo(){
					let data={goods_fight_id:this.goods_fight_id};
					let that=this;
					getCountInfo(data).then(res=>{
						that.infoCompute=res;
					})
				}
			}
		}
</script>

<style lang="scss" scoped>
	.body-top {
		background: #fffeee;
		height: 470rpx;
	}

	.z-row {
		border: solid #fb4a60;
		border-width: 1px 1px 0 0;
		width: 4px;
		height: 4px;
		position: absolute;
		left: -2px;
		top: 13px;
		background: #FFFCDA;
		z-index: 20;
		display: inline-block;
		-webkit-transform: rotate(45deg);
		font-size: 0;
		line-height: 0;
	}
</style>
